import {stringify} from 'qs';
import request from '../utils/request';
import pca from "../config/pca";

export function queryProjectNotice() {
  return request('/api/project/notice');
}

export function queryActivities() {
  return request('/api/activities');
}

export function queryRule(params) {
  return request(`/api/rule?${stringify(params)}`);
}

export function removeRule(params) {
  return request('/api/rule', {
    method: 'POST',
    body: {
      ...params,
      method: 'delete',
    },
  });
}

export function addRule(params) {
  return request('/api/rule', {
    method: 'POST',
    body: {
      ...params,
      method: 'post',
    },
  });
}

export function fakeSubmitForm(params) {
  return request('/api/forms', {
    method: 'POST',
    body: params,
  });
}

export function fakeChartData() {
  return request('/api/fake_chart_data');
}

export function queryTags() {
  return request('/api/tags');
}

export function queryBasicProfile() {
  return request('/api/profile/basic');
}

export function queryAdvancedProfile() {
  return request('/api/profile/advanced');
}

export function queryFakeList(params) {
  return request(`/api/fake_list?${stringify(params)}`);
}

export function queryNotices() {
  return request('/api/notices');
}

export function getPca() {
  // return request(`${apiPrefix}/Pca`);
  return pca;
}
